// 对于管理员的接口管理
import axios from '@/axios'

export default {
  // 获取用户
  getUser () {
    return axios.get('/user/selectAllUser')
  },
  // 更改用户状态
  changeUser (params) {
    return axios.put(`/user/updateStatus/?id=${params}`)
  },
  // 删除用户
  deleteUser (id) {
    return axios.delete(`/user/delete/?id=${id}`)
  },
  // 根据学校名称查询学校id
  selectSchoolId () {
    return axios.get('/school/selectAll')
  },
  // 一级用户注册二级用户
  addUser (params) {
    return axios.put('/user/createTow', params)
  },
  // 查看填报时间
  getDate () {
    return axios.get('/time/find')
  },
  uploadDate (sTime, eTime) {
    return axios.put(`/time/update/?sTime=${sTime}&eTime=${eTime}`)
  },
  putResetPassword (id) {
    return axios.put(`/user/resetPassword?id=${id}`)
  },

  // 查询所有学校信息
  getAllSchool (page) {
    return axios.get(`/school/selectAll/?page=${page}`)
  },
  // 查询所有学科信息
  getAllDept (page) {
    return axios.get(`/dept/selectAll/?page=${page}`)
  },
  // 添加学校
  addSchool (params) {
    return axios.put('/school/insert', params)
  },
  // 添加学科
  addDept (params) {
    return axios.put('/dept/insert', params)
  },
  // 删除学校
  deleteSchool (id) {
    return axios.delete(`/school/delete/?id=${id}`)
  },
  // 删除学科
  deleteDept (id) {
    return axios.delete(`/dept/delete/?id=${id}`)
  },
  //  开启定时提交任务
  upEndTime (eTime) {
    return axios.post(`/time/startCron/?eTime=${eTime}`)
  }
}
